package com.ruoyi.business.job;

import com.ruoyi.business.service.INoticeInfoService;
import com.ruoyi.framework.websocket.WebSocketServer;
import com.ruoyi.quartz.domain.SysJob;
import com.ruoyi.quartz.util.AbstractQuartzJob;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@DisallowConcurrentExecution
public class SystemItemJob   {
    @Autowired
    private INoticeInfoService noticeInfoService;
    @Autowired
    private WebSocketServer webSocketServer;


    @Scheduled(cron = "0/1 * * * * ?")
    protected void doExecute() throws Exception {
        webSocketServer.pushMessage(noticeInfoService.sendSystemData());
    }
}
